<template>
  <div class="my-pagination">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="paginateData.currentPage"
      :page-size="paginateData.pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="paginateData.total">
    </el-pagination>
  </div>
</template>
<script>
export default {
  props: {
    paginateData: {
      required: true,
      type: Object,
      total: {
        required: true,
        type: Number
      },
      currentPage: {
        required: true,
        type: Number
      },
      pageSize: {
        required: true,
        type: Number
      }
    }
  },
  methods: {
    handleSizeChange (val) {
      this.$emit('changePageSize', val)
    },
    handleCurrentChange (val) {
      this.$emit('changeCurrentPage', val)
    }
  }
}
</script>
<style lang="less">
  .my-pagination {
    text-align: center;
  }
</style>
